$(function(){          
	var userGrid = $("#studentRightGrid");
	userGrid.datagrid({
		url: 'classes/famentstudent',
		fit:true,
		fitColumns:true,
		border: false,
		pagination: false,
		columns : [ [{
			field: 'checkbox',
			width: 100,
			align: 'center',
			checkbox: true,
			hidden: false
		}, {
			field: 'id',
			width: 20,
			align: 'center',
			hidden: true
		}, {
			field : 'name',
			title : '学生姓名',
			align: 'center',
			width : 50
		}, {
			field : 'education',
			title : '学历',
			align: 'center',
			width : 50
		}]]
	});
	
	$("#moveoutbtn").on("click",function(){
		 var checkeds = $('#studentRightGrid').datagrid('getChecked');  
	        var idStr = '';  
	        for(var i = 0; i < checkeds.length; i++){  
	            idStr += checkeds[i].id + ",";  
	        }  
	        if(idStr.length == 0){  
	        	$.messager.alert('提示','请选择要移出的学生');
	            return;  
	        }  
	        var ids = new Array();
	        for(var j = 0;j<checkeds.length;j++){
	        	ids[j] = checkeds[j].id;
	        }
	        var tag = 1;
	        $.post("classes/famentstudentlist/"+ids+"/"+tag, null, function(rs) {
				if (rs.success) {
					//刷新数据表格
					$("#studentLeftGrid").datagrid("reload");
					userGrid.datagrid("reload");
				} else {
					$.messager.alert("提示", rs.message);
					
				}
			});

	});
});
	